home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Go64!
/
Go64_2000-07_2000_CSW_Side_B.d64
/
bmh-ma 1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
650b
|
30 lines
1 g=0
2 print"[147]"
10 t$="abraham says abracadabra but nothing moves at all. "
15 t$=t$+"so abraham decides to forget about the abracadabra thing and moves "
16 t$=t$+"the table using his hands."
17 rem
18 rem
19 dim y(127):fora=0to127:y(a)=1:next
20 input "suchwort";p$:ts=ti
21 n=len(t$)
22 m=len(p$)
100 rem boyer moore horspool
110 rem -- vorverarbeitung von p --
120 for a=64 to 91
130 y(a)=m
140 next a
150 for j=1 to m-1
155 y(asc(mid$(p$,j,1)))=m-j
170 next j
190 rem --- suche ---
200 s=1
220 for j = m to 2 step -1
230 if mid$(p$,j,1)<>mid$(t$,s+j-1,1) goto 260
240 next j
250 g=g+1
260 s=s+y(asc(mid$(t$,s+j-1,1)))
270 if s<= n-m+1 goto 220
280 print"der string wurde";g;"mal gefunden"
290 printti-ts